﻿using System;
using AllInOnePluginBL.Helpers;

public partial class ConfirmCode : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var userGuid = Request.QueryString["key"];

        if(string.IsNullOrEmpty(userGuid))
        {
            this.failureMessage.Visible = true;
            return;
        }

        var pluginDBHandler = PluginDBHandler.Instance;
        var activated = pluginDBHandler.ActivateUser(userGuid);

        if (activated)
            this.successMessage.Visible = true;
        else
            this.failureMessage.Visible = true;
    }
}